const Koa=require('koa')
const Router = require('koa-router');
const app=new Koa();
const router = new Router();

router.get('/', (ctx, next) => {
    ctx.body='孙悟空'
  });
router.get('/1', (ctx, next) => {
    ctx.body='猪八戒'
  });
router.get('/2', (ctx, next) => {
    ctx.body='沙和尚'
  });


app.use(router.routes());   /*启动路由*/
app.use(router.allowedMethods());

app.listen(3000)